package com.gls.service.demo.feign.consumer.service;

import com.gls.api.service.demo.dto.User;
import com.gls.service.demo.feign.consumer.service.impl.HelloServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author lizhiyong
 */
@FeignClient(name = "service-demo", fallback = HelloServiceImpl.class)
public interface HelloService {

    /**
     * demo示例
     *
     * @return
     */
    @RequestMapping("/hello")
    String hello();

    /**
     * demo示例
     *
     * @param name
     * @return
     */
    @RequestMapping(value = "/hello1", method = RequestMethod.GET)
    String hello(@RequestParam("name") String name);

    /**
     * demo示例
     *
     * @param name
     * @param age
     * @return
     */
    @RequestMapping(value = "/hello2", method = RequestMethod.GET)
    User hello(@RequestHeader("name") String name, @RequestHeader("age") Integer age);

    /**
     * demo示例
     *
     * @param user
     * @return
     */
    @RequestMapping(value = "/hello3", method = RequestMethod.POST)
    String hello(@RequestBody User user);

}